package net.da.core.bof.spi.local;

import net.da.core.bof.Acl;
import net.da.core.bof.Group;
import net.da.core.bof.User;
import net.da.core.entity.AclEntity;
import net.da.core.entity.Operation;
import net.da.core.exception.DaException;

public class AclImpl<E extends AclEntity> extends PersistentObjectImpl<AclEntity> implements Acl {

    public AclImpl() {
        super();
    }

    public AclImpl(AclEntity entity) {
        super(entity);
    }

    public AclEntity getEntity() {
        return (AclEntity)super.getEntity();
    }

    public Class getEntityClass() {
        return AclEntity.class;
    }

    public boolean hasPermission(Operation operation) {
        return true;
    }

    public void destroyACL() {
    }

    public void grant(Group group, Operation operation) {
        throw new UnsupportedOperationException();
    }

    public void grant(User user, Operation operation) {
        throw new UnsupportedOperationException();
    }

    @Override
    protected void preSaveValidation() throws DaException {
    }

}
